﻿using System;
using System.ComponentModel;
using System.Drawing;
using Microsoft.WowAddonStudio.FrameXml.Components.Events;
using Microsoft.WowAddonStudio.FrameXml.Serialization;
using Microsoft.WowAddonStudio.FrameXml.Serialization.LayoutFrames;

namespace Microsoft.WowAddonStudio.FrameXml.Components
{
    [ToolboxBitmap(typeof(System.Windows.Forms.PropertyGrid), "PropertyGrid.bmp")]
    [ToolboxItemFilter("WowAddonStudio", ToolboxItemFilterType.Require)]
    [EventGroup(EventGroup.PlayerModel, EventName.OnLoad)]
    public class PlayerModelControl : ModelControl
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="PlayerModelControl"/> class.
        /// </summary>
        public PlayerModelControl()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="PlayerModelControl"/> class.
        /// </summary>
        /// <param name="model">The model.</param>
        public PlayerModelControl(PlayerModel model)
            : base(model)
        {
        }

        /// <summary>
        /// Gets the Player model.
        /// </summary>
        public PlayerModel PlayerModel
        {
            get { return this.SerializationObject as PlayerModel; }
        }

        /// <summary>
        /// Gets the type of the serialization object this control manages.
        /// </summary>
        public override Type SerializationObjectType
        {
            get
            {
                return typeof(PlayerModel);
            }
        }

        /// <summary>
        /// Gets the default size of a FrameXML control.
        /// </summary>
        /// <value></value>
        protected override Size DefaultSize
        {
            get { return new Size(200, 250); }
        }
    }
}
